package com.example.mygrade.webapi;

import com.example.mygrade.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/webapi/export")
public class ExportRestController {
    @Autowired
    StudentService studentService;

    @Autowired
    TeacherService teacherService;

    @Autowired
    CourseService courseService;

    @Resource
    SCService scService;

    @Autowired
    DeptService deptService;

    @Autowired
    MajorService majorService;

    @Autowired
    ClassInfoService classInfoService;
    @GetMapping("/student")
    public void exportStudent(HttpServletResponse response){
        studentService.exportStudent(response);
    }

    @GetMapping("/teacher")
    public void exportTeacher(HttpServletResponse response){
        teacherService.exportTeacher(response);
    }

    @GetMapping("/course")
    public void exportCourse(HttpServletResponse response){
        courseService.exportCourse(response);
    }

    @GetMapping("/sc")
    public void exportSC(HttpServletResponse response){
        scService.exportSC(response);
    }

    @GetMapping("/dept")
    public void exportDept(HttpServletResponse response){
        deptService.exportDept(response);
    }
    @GetMapping("/major")
    public void exportMajor(HttpServletResponse response){
        majorService.exportMajor(response);
    }
    @GetMapping("/classinfo")
    public void exportClassinfo(HttpServletResponse response){
        classInfoService.exportClassinfo(response);
    }
}
